#ifndef _OBSERVATION_
#define _OBSERVATION_
#include<string>
#include<vector>
#include<iostream>
#include<io.h>
#include<cstring>
#include<stdint.h>
#include<Eigen/Eigen>
#include<pcl/point_cloud.h>
#include<pcl/point_types.h>
#include"Pose3D.h"
#include<pcl/kdtree/kdtree_flann.h>

using namespace std;
typedef pcl::PointXYZ PointIoType;


class Observation
{
public:
	
	Observation();
	~Observation();
	vector<string> obs_list;
	int executebin2pcd(char* source_list, const string bin_input_path);
	int observationDataInit(const string bin_input_path);
	pcl::PointCloud<PointIoType>::Ptr getFromBin(const size_t index, const string bin_input_path,bool cut = true);
	pcl::PointCloud<PointIoType>::Ptr getFromBinWithKdtree(float width,
		pcl::KdTreeFLANN<PointIoType> kdtree,
		pcl::PointCloud<PointIoType>::Ptr cloud);
	pcl::PointCloud<PointIoType>::Ptr getFromBinWithPose(const size_t index,const Pose3D& pose, const string bin_input_path);
	vector<string> listFiles(const char * dir);
	//vector<Eigen::Matrix4d> transform;
	void bin2pcd(const char*dir,const string filename, const string pcd_output_path);
	void transfromMatrix_Reader(vector<Eigen::Matrix4d> &transform, const string pose_data_path);
	void groundTruthReader(vector<Eigen::Matrix4d> &GT, const string pose_data_path);
private:
	pcl::PointCloud<PointIoType>::Ptr cloud_data;
	float threshold = { 30.0 };
};

#endif

